package org.geektimes.dependency.injection.web;

import org.geektimes.dependency.injection.web.listener.ComponentContextInitializerListener;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import java.util.Set;
import java.util.logging.Logger;

/**
 * @Author: jipeng
 * @Description:
 * @Date: Created in 2021/3/21 20:44
 */
public class ComponentContextInitializer implements ServletContainerInitializer {
    private final Logger logger = Logger.getLogger(getClass().getName());

    @Override
    public void onStartup(Set<Class<?>> set, ServletContext servletContext) throws ServletException {
        //web 中使用了xml 配置
        servletContext.addListener(new ComponentContextInitializerListener(servletContext));
    }
}
